/* 产品页面专用样式 */

/* 产品容器样式 */
.products-container {
    padding: 40px 0;
    min-height: 80vh;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* 产品卡片样式 */
.product-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image {
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.product-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: #8B4513;
    margin-bottom: 10px;
}

.product-category {
    display: inline-block;
    background: #f0f0f0;
    color: #666;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 10px;
}

/* 加载和错误状态样式 */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #e74c3c;
    background: #ffeaea;
    border-radius: 8px;
    margin: 20px 0;
}

/* 分类筛选样式 */
.category-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 10px 20px;
    border: 2px solid #8B4513;
    background: white;
    color: #8B4513;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-btn.active,
.category-btn:hover {
    background: #8B4513;
    color: white;
}

/* 搜索框样式 */
.search-box {
    max-width: 500px;
    margin: 0 auto 30px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    border-color: #8B4513;
}

.search-box button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
}

/* 筛选工具栏样式 */
.filter-toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.filter-section {
    margin-bottom: 0;
}

.filter-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-section h3::before {
    content: '📊';
    font-size: 18px;
}

/* 价格筛选样式 */
.price-filter {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.price-inputs input {
    width: 100px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.price-inputs button {
    padding: 8px 16px;
    background: #8B4513;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.price-inputs button:hover {
    background: #6b3710;
}

.price-inputs .clear-btn {
    background: #6c757d;
}

.price-inputs .clear-btn:hover {
    background: #5a6268;
}

.price-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.price-preset {
    padding: 6px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.price-preset:hover,
.price-preset.active {
    background: #8B4513;
    color: white;
    border-color: #8B4513;
}

/* 排序选项样式 */
.sort-options select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* 筛选结果统计 */
.filter-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #e8f5e8;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

#result-count {
    font-weight: 600;
    color: #155724;
}

.active-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.active-filter-tag {
    background: #8B4513;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.active-filter-tag .remove-filter {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    margin-left: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .products-container {
        padding: 20px 0;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
        margin-top: 20px;
    }
    
    .filter-toolbar {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .price-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .price-inputs input {
        width: 100%;
    }
    
    .filter-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .category-filter {
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .category-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .search-box {
        margin-bottom: 20px;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .product-name {
        font-size: 16px;
    }
    
    .product-price {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .filter-toolbar {
        padding: 15px;
    }
    
    .price-presets {
        justify-content: center;
    }
    
    .price-preset {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .filter-section h3 {
        font-size: 14px;
    }
    
    .sort-options select {
        font-size: 13px;
        padding: 8px 12px;
    }
}